﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/HRManagerUI/HrManager.Master"
    AutoEventWireup="true" CodeBehind="PunishedEmployee.aspx.cs" Inherits="HRM.UI.HRManagerUI.PunishmentUI.PunishedEmployee" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContentBody" runat="server">
    <link href="../../../Styles/Punishment/PunishedCss.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/htmlDatePicker.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/htmlDatePicker.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">

        function CheckField() {
            if (document.getElementById("<%=txtEmployeeCode.ClientID%>").value == "") {
                document.getElementById("<%=msgLbl.ClientID%>").textContent = "Please Enter Employee Code!";
                document.getElementById("<%=msgLbl.ClientID%>").style.color = "red";
                document.getElementById("<%=txtEmployeeCode.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=selectPunishmentType.ClientID%>").Value == "") {
                document.getElementById("<%=msgLbl.ClientID%>").textContent = "Please Enter Punishment Name";
                document.getElementById("<%=msgLbl.ClientID%>").style.color = "red";
                document.getElementById("<%=selectPunishmentType.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=selectPunishedProcedure.ClientID%>").Value == "") {
                document.getElementById("<%=msgLbl.ClientID%>").textContent = "Please Enter Punished Procedure!";
                document.getElementById("<%=msgLbl.ClientID%>").style.color = "red";
                document.getElementById("<%=selectPunishedProcedure.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=txtPunishedBy.ClientID%>").Value == "") {
                document.getElementById("<%=msgLbl.ClientID%>").textContent = "Please Enter Punished By Code!";
                document.getElementById("<%=msgLbl.ClientID%>").style.color = "red";
                document.getElementById("<%=txtPunishedBy.ClientID%>").focus();
                return false;
            }
            return true;
        }
  

    </script>
    <fieldset>
        <legend>Punished Employee</legend>
        <div align="center">
            <asp:Label runat="server" ID="msgLbl"></asp:Label>
        </div>
        <div id="container">
            <div id="prothomTB">
                <table class="mainTBPunish">
                    <tr>
                        <td class="Label">
                            Enployee Code:
                        </td>
                        <td class="Field">
                            <asp:TextBox runat="server" ID="txtEmployeeCode" OnTextChanged="txtEmployeeCode_TextChanged"
                                AutoPostBack="True" CssClass="textboxinput" /><span class="estaricStar"> *</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="Label">
                            Punishment:
                        </td>
                        <td>
                            <select runat="server" id="selectPunishmentType" class="dropdownCss" />
                            <span class="estaricStar">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="Label">
                            Punished Procedure
                        </td>
                        <td>
                            <select runat="server" id="selectPunishedProcedure" class="dropdownCss" /><span class="estaricStar">
                                *</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="Label">
                            Date:
                        </td>
                        <td>
                            <input type="text" runat="server" id="txtDate" readonly onclick="GetDate(this);"
                                class="textboxinput" />
                        </td>
                    </tr>
                    <tr>
                        <td class="Label">
                            Remarks:
                        </td>
                        <td>
                            <textarea runat="server" id="txtRemarks" cols="15" rows="2" class="inputTextarea"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td class="Label">
                            Punished By
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtPunishedBy" AutoPostBack="True" OnTextChanged="txtPunishedBy_TextChanged"
                                CssClass="textboxinput" /><span class="estaricStar">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <input type="submit" runat="server" id="createPunishment" value="Create Punishment"
                                onserverclick="CreatePunishment" class="btnCss" onclick="return CheckField()" />
                        </td>
                    </tr>
                </table>
            </div>
            <div id="secondTB">
                <table class="infoTBEmp">
                    <tr>
                        <td>
                            Punished Employee:
                        </td>
                    </tr>
                    <tr>
                        <td class="infoTD">
                            <asp:Label runat="server" ID="empNameLbl"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Punished By:
                        </td>
                    </tr>
                    <tr>
                        <td class="infoTD">
                            <asp:Label runat="server" ID="punishedByNameLbl"></asp:Label>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <br />
    </fieldset>
    <div align="center"><asp:Label runat="server" ID="lblDelete"></asp:Label></div>
    <fieldset>
        <legend>All Punishment Employee List</legend>
        <table width="100%" class="searchpunishTB">
            <tr>
                <td align="right">
                    Search By Employee Code
                    <input type="text" runat="server" id="txtSearchByCode" class="punishmentsearch" />
                    Search By Punished Type
                    <%-- <select type="text" runat="server" id="selectSearchByType"/>--%>
                    <asp:DropDownList runat="server" ID="selectSearchByType" CssClass="punishmentsearch">
                    </asp:DropDownList>
                    <input type="button" runat="server" id="searchButton" value="Find" onserverclick="FindPunishedEmployee"
                        class="btnCsss" />
                    <input type="button" runat="server" id="viewAll" value="All" onserverclick="GetAll"
                        class="btnCsss" />
                </td>
            </tr>
        </table>
        <div id="viewPunishedEmployeeDiv">
            <asp:GridView runat="server" ID="viewPunishedEmployeeGdv" BorderColor="#CCCCCC" CellPadding="3"
                AutoGenerateColumns="False" OnPageIndexChanging="viewPunishedEmployeeGdv_PageIndexChanging"
                AllowPaging="True" PageSize="6" CssClass="GridviewStyle" BackColor="White" BorderStyle="None"
                BorderWidth="1px" onrowdeleting="viewPunishedEmployeeGdv_RowDeleting">
                <Columns>
                    <asp:TemplateField HeaderText="Code">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("EmpCode") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("EmpCode") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Employee Name">
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Designation">
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("Designation") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Designation") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Project">
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("Project") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Project") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Punishment">
                        <ItemTemplate>
                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("Punishment") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Punishment") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Punished Procedure">
                        <ItemTemplate>
                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("PunishedProcedure") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("PunishedProcedure") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Punished By">
                        <ItemTemplate>
                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("PunishedBy") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("PunishedBy") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Remarks">
                        <ItemTemplate>
                            <asp:Label ID="Label8" runat="server" Text='<%# Bind("Remarks") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("Remarks") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Date">
                        <ItemTemplate>
                            <asp:Label ID="Label9" runat="server" Text='<%# Bind("Date") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("Date") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Status">
                        <ItemTemplate>
                            <asp:Label ID="Label10" runat="server" Text='<%# Bind("Status") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("Status") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Id" Visible="False">
                        <ItemTemplate>
                            <asp:Label ID="lblId" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Delete">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" ID="linkRemove" CommandArgument='<%# Bind("Id")%>'
                                CommandName="Delete" Text="Delete" OnClientClick="return confirm('Do you want to delete this Training?')">
                            </asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle CssClass="GridViewFooterStyle" />
                <HeaderStyle CssClass="GridViewHeaderStyle" />
                <PagerStyle CssClass="GridViewFooterStyle" HorizontalAlign="Center" />
                <RowStyle ForeColor="#000066" />
                <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#007DBB" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#00547E" />
            </asp:GridView>
            <hr />
            <asp:Label runat="server" ID="countLbl" Font-Bold="True" ForeColor="#006600"></asp:Label>
        </div>
    </fieldset>
</asp:Content>
